Generally, packet header information is divided by ROHC into two parts including a static field and a dynamic field. The static field refers to a rarely changing or almost unchanging field in a service stream packet header; and the dynamic field refers to a frequently changing field in the service stream packet header.
A header Compression Technology is embodied as data interaction between a state machine of a compressor and a state machine of a decompressor.
States of the state machine of the compressor include three states: an Initialization and Refresh (IR) state, a First Order (FO) state, and a Second Order (SO) state. FIG. 1 is a schematic diagram in implementation showing state transition of a state machine of a compressor; as shown in FIG. 1, in the IR state, the compressor sends packet header information to a decompressor by way of non-compress; the state machine of the compressor transits from the IR state to the FO state when the compressor learns that the decompressor successfully parses a static field of a packet header; and the state machine of the compressor transits from the IR state to the SO state when the compressor learns that the decompressor successfully parses the static field and a dynamic field of the packet header. When the state machine of the compressor is in the SO state and after the compressor learns that the decompressor fails in parsing the dynamic field of the packet header, the state machine of the compressor transits from the SO state to the FO state; and the state machine of the compressor transits from the SO state to the IR state when the compressor learns that the decompressor fails in parsing both the static field and the dynamic field of the packet header. When the state machine of the compressor is in the FO state and after the compressor learns that the decompressor fails in parsing the static field of the packet header, the state machine of the compressor transits from the FO state to the IR state. When the state transits back to the IR state, the state machine of the compressor returns to an initial state, and the compressor sends a packet to the decompressor again.
States of the state machine of the decompressor also include three states: a No Context (NC) state, a Static Context (SC) state and a Full Context (FC) state. FIG. 2 is a schematic diagram in implementation showing state transition of a state machine of a decompressor; as shown in FIG. 2, the state machine of the decompressor is in the NC state during initial work, and the state machine of the decompressor transits from the NC state to the FC state after a decompressor end receives a packet sent by the compressor and both a static field and a dynamic field of the packet header of the packet are successfully parsed; otherwise, the state machine of the decompressor maintains in the NC state. The state machine of the decompressor transits from the FC state to the SC state when the state machine of the decompressor is in the FC state and number of failures of the decompressor in parsing the dynamic field of the packet header exceeds a preset threshold value; otherwise the state machine of the decompressor maintains in the FC state. The state machine of the decompressor transits to the FC state when the state machine of the decompressor is in the SC state and the decompressor successfully parses the dynamic field of the packet header; the state machine of the decompressor transits to the NC state when number of failures of the decompressor in parsing the dynamic field of the packet header exceeds a preset threshold value; and when the state machine of the decompressor transits back to the NC state, the decompressor returns to an initial state and performs state transition on a next packet according to decompression situations of packets.
It can be seen form above that the state machine of the compressor and the state machine of the decompressor need to frequently transit among different states according to packet decompression situations. Consequently, number of transition is increased, and processing speed and processing efficiency of state machine resources are lowered.